Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth pairing cancellation error handling #122

Merged
merged 8 commits into from
Mar 3, 2022

Conversation

dhenry-stripe
Copy link
Contributor

@dhenry-stripe dhenry-stripe commented Mar 3, 2022

Addresses #109 and #49

  • DiscoverReadersScreen.connectingReader gets reset on discovery error
  • locationId is required for connectBluetoothReader
  • Android onUnexpectedReaderDisconnect sends didFinishDiscoveringReaders event
  • DiscoverReadersScreen discovery failure triggers navigation.goBack

@@ -134,7 +134,7 @@ export default function DiscoverReadersScreen() {
}, []);

const handleConnectReader = async (reader: Reader.Type) => {
let error: StripeError;
let error: StripeError | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason not to just OR it with null? Also the syntax

let error?: StripeError | null;

will let it be undefined or null

Copy link
Contributor Author

@dhenry-stripe dhenry-stripe Mar 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I swapped it out but StripeError | undefined is required by handleConnectBluetoothReader and handleConnectInternetReader so leaving as undefined

@dhenry-stripe dhenry-stripe merged commit 7562ee0 into main Mar 3, 2022
arekkubaczkowski pushed a commit to arekkubaczkowski/stripe-terminal-react-native that referenced this pull request Jun 29, 2022
* connectingReader reset on error

* locationId required for connectBluetoothReader

* code style

* onUnexpectedReaderDisconnect sends didFinishDiscoveringReaders event

* DiscoverReaders failure triggers navigation.goBack

* typecheck

* replacing undefined with null

* back to undefined
@nazli-stripe nazli-stripe deleted the dhenry/discover-error-reset branch September 6, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants